package com.yonyou.pmclouds.safetyrectification.relationuser.service.rmiimpl;

import com.alibaba.dubbo.config.annotation.Service;
import com.yonyou.pmclouds.ApplicationConsts;
import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.safetyrectification.relationuser.entity.RelationUserVO;
import com.yonyou.pmclouds.safetyrectification.relationuser.mapper.RelationUserMapper;
import com.yonyou.pmclouds.safetyrectification.relationuser.service.IRelationUserQuery;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.ArrayList;
import java.util.List;

/**
 * @author tanghuan
 * @date 2019/10/26
 */
@Service(interfaceClass = IRelationUserQuery.class, version = ApplicationConsts.APPLICATION_VERSION)
public class RelationUserQueryImpl implements IRelationUserQuery {
    @Autowired
    private RelationUserMapper mapper;

    @Override
    public RelationUserVO getById(String id) throws BusinessException {
        return mapper.getById(id);
    }

    @Override
    public List<RelationUserVO> getByPkBill(String pkBill) {
        if (StringUtils.isEmpty(pkBill))
            return new ArrayList<>();

        return mapper.getByPkBill(pkBill);
    }

}
